package com.app.Activity;

import com.app.Tree.NoteDialog;

import android.app.AlertDialog;
import android.app.Application;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.Context;
import android.text.GetChars;
import android.view.Display;
import android.view.WindowManager;
import android.widget.TextView;
import android.widget.Toast;

public class MESApplication extends Application{
	 private static Context context;

	    public void onCreate(){
	        super.onCreate();
	        MESApplication.context = getApplicationContext();
	    }

	    public static Context getAppContext() {
	        return MESApplication.context;
	    }
	    public static int getWidth(){
	    	WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
	    	Display display = wm.getDefaultDisplay();
	    	return display.getWidth();
	    }
	    public static int getHeight(){
	    	WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
	    	Display display = wm.getDefaultDisplay();
	    	return display.getHeight();
	    }
	    public static void showDialog(Context context,String title, String message){
			AlertDialog.Builder buidler=new Builder(context);
			buidler.setTitle(title);
			buidler.setMessage(message);
			buidler.setNegativeButton("Đóng", null);
			buidler.show();
		}
}
